/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package csse3004.GD.PAdmin;

import org.springframework.web.servlet.mvc.Controller;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import java.util.Map;
import java.util.HashMap;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import csse3004.GD.PM.PollManager;
import csse3004.GD.Poll;


/**
 *
 * @author Mamdouh Alharbi 41942989
 */
public class NewPollCreatorController implements Controller {


   protected final Log logger = LogFactory.getLog(getClass());
    
    
   
      
    public ModelAndView handleRequest(HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {
        Map<String, Object> myModel = new HashMap<String, Object>();

        Poll[] polls = new Poll[3];
        polls[0] = new Poll();
        polls[0].setName("Poll 1");
        polls[1] = new Poll();
        polls[1].setName("Poll 2");
        polls[2] = new Poll();
        polls[2].setName("Poll 3");
        
         
        
        return new ModelAndView("newPollCreator", "polls", polls);
        
    }
    
    
}
